FROM php-fpm:7.3.25-alpine3.12

RUN set -eux; \
	\
	apk add --no-cache --virtual .build-deps curl-dev; \
	\
	curl -fsSL 'https://pecl.php.net/get/solr-2.5.1.tgz' -o solr.tar.gz; \
	\
	mkdir -p /tmp/solr; \
	tar -xf solr.tar.gz -C /tmp/solr --strip-components=1; \
	\
	rm solr.tar.gz; \
	docker-php-ext-configure /tmp/solr --enable-solr; \
	docker-php-ext-install /tmp/solr; \
	rm -r /tmp/solr; \
	php -m |grep solr; \
	apk del --no-network .build-deps